System and method for facilitating efficient packet injection into an output buffer in a network interface controller (nic)

ABSTRACT

A network interface controller (NIC) capable of efficient packet injection into an output buffer is provided. The NIC can be equipped with an output buffer, a plurality of injectors, a prioritization logic block, and a selection logic block. The plurality of injectors can share the output buffer. The prioritization logic block can determine a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector. The selection logic block can then determine, from the plurality of injectors, a subset of injectors associated with a buffer class and determine whether the subset of injectors includes a high-priority injector. Upon identifying a high-priority injector in the subset of injectors, the selection logic block can select the high-priority injector for injecting a packet in the output buffer.

BACKGROUND Field

This is generally related to the technical field of networking. More specifically, this disclosure is related to systems and methods for facilitating efficient packet injection into an output buffer in a network interface controller (NIC).

Related Art

As network-enabled devices and applications become progressively more ubiquitous, various types of traffic as well as the ever-increasing network load continue to demand more performance from the underlying network architecture. For example, applications such as high-performance computing (HPC), media streaming, and Internet of Things (IOT) can generate different types of traffic with distinctive characteristics. As a result, in addition to conventional network performance metrics such as bandwidth and delay, network architects continue to face challenges such as scalability, versatility, and efficiency.

SUMMARY

A network interface controller (NIC) capable of efficient packet injection into an output buffer is provided. The NIC can be equipped with an output buffer, a plurality of injectors, a prioritization logic block, and a selection logic block. The plurality of injectors can share the output buffer. The prioritization logic block can determine a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector. The selection logic block can then determine, from the plurality of injectors, a subset of injectors associated with a buffer class and determine whether the subset of injectors includes a high-priority injector. Upon identifying a high-priority injector in the subset of injectors, the selection logic block can select the high-priority injector for injecting a packet in the output buffer.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 shows an exemplary network.

FIG. 2A shows an exemplary NIC chip with a plurality of NICs.

FIG. 2B shows an exemplary architecture of a NIC.

FIG. 3A shows an exemplary packet injection into an output buffer in a NIC.

FIG. 3B shows an exemplary arbitration process for injecting packets into an output buffer in a NIC.

FIG. 4A shows a flow chart of a priority allocation process for injecting packets into an output buffer in a NIC.

FIG. 4B shows a flow chart of an arbitration process for injecting packets into an output buffer in a NIC.

FIG. 5 shows an exemplary computer system equipped with a NIC that facilitates efficient injection of packets into an output buffer.

In the figures, like reference numerals refer to the same figure elements.

DETAILED DESCRIPTION

Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Thus, the present invention is not limited to the embodiments shown.

Overview

The present disclosure describes systems and methods that facilitate efficient packet injection into an output buffer in a network interface controller (NIC). The NIC allows a host to communicate with a data-driven network. The network can accommodate dynamic data traffic with fast, effective congestion control by maintaining state information of individual packet streams. More specifically, packets injected into the network of switches can be categorized into streams, which can be mapped to their layer-2, layer-3, or other protocol-specific header information. Each stream can be marked by a distinctive identifier that is local to an input port of a switch, and provided with a stream-specific input buffer so that each stream can be individually flow-controlled. In addition, packets of a respective stream can be acknowledged upon reaching the egress point of the network, and the acknowledgment packets can be sent back to the ingress point of the stream along the same data path in the reverse direction. As a result, each switch can obtain state information of active packet streams it is forwarding and can perform highly responsive, stream-specific flow control. Such flow control can allow the network to operate at higher capacity while providing versatile traffic-engineering capabilities.

The embodiments described herein solve the problem of efficiently allocating packets from a plurality of injectors to a shared output buffer of a NIC by (i) determining a priority for a respective injector based on the buffer occupancy of the injector, and (ii) arbitrating among the injectors based on a class and the determined priorities. An injector can be any element of the NIC that may inject traffic into the buffer.

During operation, the NIC may receive a command from a host device of the NIC. A host interface of the NIC may couple the NIC with the host device and facilitate the communication between the host device and the NIC. The command can be an immediate data command (IDC) or a direct memory access (DMA) command. A command that carries the data associated with the command can be an IDC. On the other hand, a command with a pointer to the relevant data is referred to as a DMA command (DMAC) (e.g., a “GET” or a “PUT” command of remote DMA (RDMA)). Furthermore, the traffic generated based on the commands can be assigned to different classes, such as traffic shaping classes or buffer classes. Each buffer class may be associated with one or more injectors. On the other hand, an injector may be allocated to one buffer class. Consequently, for the same buffer class, multiple injectors may send packets in parallel.

However, the injectors may share a common output buffer. As a result, if a large number of injectors share the buffer, due to the uneven and random nature of traffic, one injector may occupy a significant portion of the buffer. In contrast, another injector may not have access to sufficient buffer capacity. Consequently, the buffer can cause under-utilization for some injectors while causing a bottleneck for other injectors. Furthermore, the buffer can be unfairly shared among the injectors and the buffer classes of the injectors.

To solve this problem, the NIC can arbitrate among the injectors in such a way that the capacity of the buffer is fairly distributed. The buffer can be divided into a number of cells. A respective cell can have a fixed size (e.g., 2048 bytes). An injector may insert traffic into the buffer at a granularity of the cell size. To ensure fair allocation of the buffer capacity to an injector, the NIC can select an injector for inserting traffic into a next available cell based on one or more selection criteria. The selection criteria can allow the NIC to select an undersubscribed (or underutilized) injector and avoid selecting an oversubscribed (or over-utilized) injector. In addition, the NIC can also distinguish between an IDC and a DMAC. Furthermore, the NIC can select an injector to ensure a fair distribution of buffer capacity among the buffer classes. In some embodiments, an injector can be a message chopping unit (MCU) module, which can fragment a message into packets of sizes corresponding to a maximum transmission unit (MTU).

During operation, the NIC can allocate a priority to a respective injector based on a limit associated with the injector (e.g., a maximum capacity of the buffer that can be allocated to the injector). The NIC can determine a type of command associated with an injector. Since the DMACs typically stay longer in the buffer (e.g., due to additional memory access for obtaining associated data), the NIC may use a per-injector limit for a DMAC and use an overall limit for an IDC command. Based on the limit, the NIC can determine a high watermark and a low watermark for the injector that can be used to determine over- and under-subscription, respectively. The high watermark can indicate a capacity that can be close to the limit. On the other hand, the low watermark can indicate a capacity that can be significantly less than the limit.

The NIC can then determine the number of cells in the buffer currently being occupied by data from the injector. If the occupied cells represent a capacity greater than or equal to the high watermark, the NIC can assign a low priority to the injector. On the other hand, if the occupied cells represent a capacity less than or equal to the low watermark, the NIC can assign a high priority to the injector. The NIC can allocate a priority to each of the injectors by repeating this process. The NIC can then perform a two-phase arbitration process to select an injector for the next available cell in the buffer. In the first phase, the NIC can select a buffer class (e.g., based on weighted round-robin selection).

Upon selecting the buffer class, the NIC can identify a respective injector associated with the buffer class. The NIC can then determine whether the identified injectors include an injector with a high priority. If the identified injectors include at least one injector with the high priority, the NIC may select the injector. However, for selecting from a plurality of such injectors, the NIC may use a selection policy, such as round-robin and first-available selection, to select one of the injectors. On the other hand, if the identified injectors only include injectors with the low priority, the NIC can select one of these injectors based on the selection policy. To ensure that the priorities are not allocated to an injector for a prolonged period, the NIC can periodically perturb the priorities. In this way, the NIC can facilitate an efficient way of allocating packets to the shared output buffer.

One embodiment of the present invention provides a NIC that can be equipped with an output buffer, a plurality of injectors, a prioritization logic block, and a selection logic block. The plurality of injectors can share the output buffer. The prioritization logic block can determine a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector. The selection logic block can then determine, from the plurality of injectors, a subset of injectors associated with a buffer class and determine whether the subset of injectors includes a high-priority injector. Upon identifying a high-priority injector in the subset of injectors, the selection logic block can select the high-priority injector for injecting a packet in the output buffer.

In a variation on this embodiment, if the subset of injectors does not include a high-priority injector, the selection logic block can select a low-priority injector for injecting a packet in the output buffer.

In a variation on this embodiment, the prioritization logic block can determine a command type associated with a respective injector. If the command type is an immediate data command (IDC), the prioritization logic block may determine the high watermark and the low watermark based on a global limit. On the other hand, if the command type is a direct memory access (DMA) command, the prioritization logic block may determine the high watermark and the low watermark based on a limit specific to the injector.

In a further variation, the command is issued to the NIC via a peripheral component interconnect express (PCIe) interface.

In a variation on this embodiment, the prioritization logic block can obtain a number of units in the buffer being occupied by data from a respective injector.

In a further variation, the prioritization logic block can assign a high priority to the injector if the number of units is less than or equal to the low watermark. On the other hand, the prioritization logic block can assign a low priority to the injector if the number of units is greater than or equal to the high watermark.

In a variation on this embodiment, upon detecting a reset of priorities, the prioritization logic block can assign a high priority to the injector. Furthermore, the prioritization logic block can assign a low priority to the injector if a timer associated with the injector has expired.

In a variation on this embodiment, the selection logic block can select the buffer class from a set of buffer classes enabled for the NIC.

In a variation on this embodiment, an injector can be a message chopping unit (MCU) to generate a packet from a command issued to the NIC.

In a variation on this embodiment, the output buffer is divided into a number of cells. Injecting the packet then can include injecting the packet into a next available cell.

In this disclosure, the description in conjunction with FIG. 1 is associated with the network architecture and the description in conjunction with FIG. 2A and onward provide more details on the architecture and operations associated with a NIC that supports efficient management of idempotent operations.

FIG. 1 shows an exemplary network. In this example, a network 100 of switches, which can also be referred to as a “switch fabric,” can include switches 102, 104, 106, 108, and 110. Each switch can have a unique address or ID within switch fabric 100. Various types of devices and networks can be coupled to a switch fabric. For example, a storage array 112 can be coupled to switch fabric 100 via switch 110; an InfiniBand (IB) based HPC network 114 can be coupled to switch fabric 100 via switch 108; a number of end hosts, such as host 116, can be coupled to switch fabric 100 via switch 104; and an IP/Ethernet network 118 can be coupled to switch fabric 100 via switch 102. In general, a switch can have edge ports and fabric ports. An edge port can couple to a device that is external to the fabric. A fabric port can couple to another switch within the fabric via a fabric link. Typically, traffic can be injected into switch fabric 100 via an ingress port of an edge switch, and leave switch fabric 100 via an egress port of another (or the same) edge switch. An ingress link can couple a NIC of an edge device (for example, an HPC end host) to an ingress edge port of an edge switch. Switch fabric 100 can then transport the traffic to an egress edge switch, which in turn can deliver the traffic to a destination edge device via another NIC.

Exemplary NIC Architecture

FIG. 2A shows an exemplary NIC chip with a plurality of NICs. With reference to the example in FIG. 1, a NIC chip 200 can be a custom application-specific integrated circuit (ASIC) designed for host 116 to work with switch fabric 100. In this example, chip 200 can provide two independent NICs 202 and 204. A respective NIC of chip 200 can be equipped with a host interface (HI) (e.g., an interface for connecting to the host processor) and one High-speed Network Interface (HNI) for communicating with a link coupled to switch fabric 100 of FIG. 1. For example, NIC 202 can include an HI 210 and an HNI 220, and NIC 204 can include an HI 211 and an HNI 221.

In some embodiments, HI 210 can be a peripheral component interconnect (PCI) or a peripheral component interconnect express (PCIe) interface. HI 210 can be coupled to a host via a host connection 201, which can include N (e.g., N can be 16 in some chips) PCIe Gen 4 lanes capable of operating at signaling rates up to 25 Gbps per lane. HNI 210 can facilitate a high-speed network connection 203, which can communicate with a link in switch fabric 100 of FIG. 1. HNI 210 can operate at aggregate rates of either 100 Gbps or 200 Gbps using M (e.g., M can be 4 in some chips) full-duplex serial lanes. Each of the M lanes can operate at 25 Gbps or 50 Gbps based on non-return-to-zero (NRZ) modulation or pulse amplitude modulation 4 (PAM4), respectively. HNI 220 can support the Institute of Electrical and Electronics Engineers (IEEE) 802.3 Ethernet-based protocols as well as an enhanced frame format that provides support for higher rates of small messages.

NIC 202 can support one or more of: point-to-point message passing based on Message Passing Interface (MPI), remote memory access (RMA) operations, offloading and progression of bulk data collective operations, and Ethernet packet processing. When the host issues an MPI message, NIC 202 can match the corresponding message type. Furthermore, NIC 202 can implement both eager protocol and rendezvous protocol for MPI, thereby offloading the corresponding operations from the host.

Furthermore, the RMA operations supported by NIC 202 can include PUT, GET, and Atomic Memory Operations (AMO). NIC 202 can provide reliable transport. For example, if NIC 202 is a source NIC, NIC 202 can provide a retry mechanism for idempotent operations. Furthermore, connection-based error detection and retry mechanism can be used for ordered operations that may manipulate a target state. The hardware of NIC 202 can maintain the state necessary for the retry mechanism. In this way, NIC 202 can remove the burden from the host (e.g., the software). The policy that dictates the retry mechanism can be specified by the host via the driver software, thereby ensuring flexibility in NIC 202.

Furthermore, NIC 202 can facilitate triggered operations, a general-purpose mechanism for offloading, and progression of dependent sequences of operations, such as bulk data collectives. NIC 202 can support an application programming interface (API) (e.g., libfabric API) that facilitates fabric communication services provided by switch fabric 100 of FIG. 1 to applications running on host 116. NIC 202 can also support a low-level network programming interface, such as Portals API. In addition, NIC 202 can provide efficient Ethernet packet processing, which can include efficient transmission if NIC 202 is a sender, flow steering if NIC 202 is a target, and checksum computation. Moreover, NIC 202 can support virtualization (e.g., using containers or virtual machines).

FIG. 2B shows an exemplary architecture of a NIC. In NIC 202, the port macro of HNI 220 can facilitate low-level Ethernet operations, such as physical coding sublayer (PCS) and media access control (MAC). In addition, NIC 202 can provide support for link layer retry (LLR). Incoming packets can be parsed by parser 228 and stored in buffer 229. Buffer 229 can be a PFC Buffer provisioned to buffer a threshold amount (e.g., one microsecond) of delay bandwidth. HNI 220 can also include control transmission unit 224 and control reception unit 226 for managing outgoing and incoming packets, respectively.

NIC 202 can include a Command Queue (CQ) unit 230. CQ unit 230 can be responsible for fetching and issuing host side commands. CQ unit 230 can include command queues 232 and schedulers 234. Command queues 232 can include two independent sets of queues for initiator commands (PUT, GET, etc.) and target commands (Append, Search, etc.), respectively. Command queues 232 can be implemented as circular buffers maintained in the memory of NIC 202. Applications running on the host can write to command queues 232 directly. Schedulers 234 can include two separate schedulers for initiator commands and target commands, respectively. The initiator commands are sorted into flow queues 236 based on a hash function. One of flow queues 236 can be allocated to a unique flow. Furthermore, CQ unit 230 can further include a triggered operations module 238, which is responsible for queuing and dispatching triggered commands.

Outbound transfer engine (OXE) 240 can pull commands from flow queues 236 in order to process them for dispatch. OXE 240 can include an address translation request unit (ATRU) 244 that can send address translation requests to address translation unit (ATU) 212. ATU 212 can provide virtual to physical address translation on behalf of different engines, such as OXE 240, inbound transfer engine (IXE) 250, and event engine (EE) 216. ATU 212 can maintain a large translation cache 214. ATU 212 can either perform translation itself or may use host-based address translation services (ATS). OXE 240 can also include message chopping unit (MCU) 246, which can fragment a large message into packets of sizes corresponding to a maximum transmission unit (MTU). MCU 246 can include a plurality of MCU modules. When an MCU module becomes available, the MCU module can obtain the next command from an assigned flow queue. The received data can be written into data buffer 242. The MCU module can then send the packet header, the corresponding traffic class, and the packet size to traffic shaper 248. Shaper 248 can determine which requests presented by MCU 246 can proceed to the network.

Subsequently, the selected packet can be sent to packet and connection tracking (PCT) 270. PCT 270 can store the packet in a queue 274. PCT 270 can also maintain state information for outbound commands and update the state information as responses are returned. PCT 270 can also maintain packet state information (e.g., allowing responses to be matched to requests), message state information (e.g., tracking the progress of multi-packet messages), initiator completion state information, and retry state information (e.g., maintaining the information required to retry a command if a request or response is lost). If a response is not returned within a threshold time, the corresponding command can be stored in retry buffer 272. PCT 270 can facilitate connection management for initiator and target commands based on source tables 276 and target tables 278, respectively. For example, PCT 270 can update its source tables 276 to track the necessary state for reliable delivery of the packet and message completion notification. PCT 270 can forward outgoing packets to HNI 220, which stores the packets in outbound queue 222.

NIC 202 can also include an IXE 250, which provides packet processing if NIC 202 is a target or a destination. IXE 250 can obtain the incoming packets from HNI 220. Parser 256 can parse the incoming packets and pass the corresponding packet information to a List Processing Engine (LPE) 264 or a Message State Table (MST) 266 for matching. LPE 264 can match incoming messages to buffers. LPE 264 can determine the buffer and start address to be used by each message. LPE 264 can also manage a pool of list entries 262 used to represent buffers and unexpected messages. MST 266 can store matching results and the information required to generate target side completion events. MST 266 can be used by unrestricted operations, including multi-packet PUT commands, and single-packet and multi-packet GET commands.

Subsequently, parser 256 can store the packets in packet buffer 254. IXE 250 can obtain the results of the matching for conflict checking. DMA write and AMO module 252 can then issue updates to the memory generated by write and AMO operations. If a packet includes a command that generates target side memory read operations (e.g., a GET response), the packet can be passed to the OXE 240. NIC 202 can also include an EE 216, which can receive requests to generate event notifications from other modules or units in NIC 202. An event notification can specify that either a fill event or a counting event is generated. EE 216 can manage event queues, located within host processor memory, to which it writes full events. EE 216 can forward counting events to CQ unit 230.

Efficient Packet Injection in NIC

FIG. 3A shows an exemplary packet injection into an output buffer in a NIC. In this example, host device 300 can include a NIC 320. A host interface 322 of NIC 320 may couple NIC 320 with device 300 and facilitate the communication between device 300 and NIC 320. NIC 320 can include an MCU 324, which can include a plurality of MCU modules 312, 314, 416, and 318. The MCU modules in MCU 324 can inject traffic into a shared output buffer 328. Therefore, the MCU modules in MCU 324 can be the injectors for buffer 328. The traffic injected by MCU 324 may belong to different buffer classes. Each buffer class may be associated with one or more MCU modules. On the other hand, an MCU module may be allocated to one buffer class. Consequently, for the same buffer class, multiple MCU modules may inject packets in parallel.

However, since the MCU modules can share buffer 328, due to the uneven and random nature of traffic, one MCU module may occupy a significant portion of buffer 328. In contrast, another MCU module may not have access to sufficient buffer capacity. Consequently, buffer 328 can cause under-utilization for some MCU modules while causing a bottleneck for other MCU modules. Furthermore, buffer 328 can be unfairly shared among the MCU modules and the buffer classes of the MCU modules.

To solve this problem, NIC 320 can be equipped with an arbitrator 326 that can arbitrate among the MCU modules in MCU 324 in such a way that the capacity of buffer 328 is fairly distributed. Buffer 328 can be divided into a number of cells. A respective cell can have a fixed size. A respective MCU module, such as MCU module 312, may insert traffic into buffer 328 at a granularity of the cell size. To ensure fair allocation of the capacity of buffer 328 to an MCU module, arbitrator 326 can select an MCU module for inserting traffic into a next available cell 330 based on one or more selection criteria. The selection criteria can allow arbitrator 326 to select an undersubscribed MCU module and avoid selecting an oversubscribed MCU module.

Furthermore, arbitrator 326 can also distinguish among an IDC and a DMAC. Suppose that an IDC 342 is allocated to MCU module 312 and a DMAC 344 is allocated to MCU module 318. Since DMAC 344 may stay longer in buffer 328, arbitrator 326 may use a limit (e.g., a maximum number of cells of buffer 328 that can be allocated to an MCU module) specific to MCU module 312 to determine whether to select MCU module 312. On the other hand, arbitrator 326 may use a global limit associated with IDCs to determine whether to select MCU module 318. Furthermore, arbitrator 326 can select an MCU module to ensure a fair distribution of buffer capacity among the buffer classes.

FIG. 3B shows an exemplary arbitration process for injecting packets into an output buffer in a NIC. To facilitate efficient injection of packets into buffer 328, arbitrator 326 can allocate a priority to a respective MCU module in MCU 324 based on the limit associated with the MCU module. Arbitrator 326 can determine that MCU module 312 is associated with IDC 342. Hence, arbitrator 326 can determine a high watermark and a low watermark for MCU module 312 based on the global limit associated with IDCs. Arbitrator 326 can then determine the number of cells in the buffer currently being occupied by data from MCU module 312. The number (or count) of the occupied cells can be referred to as the occupied cell count (OCC). If the OCCs of MCU module 312 is greater than or equal to the high watermark, arbitrator 326 can assign a low priority to MCU 312. On the other hand, if OCCs of MCU module 312 is less than or equal to the low watermark, arbitrator 326 can assign a high priority to MCU module 312.

Similarly, arbitrator 326 may allocate a priority to MCU modules 314, 316, and 318 by repeating this process. For example, arbitrator 326 can determine that MCU module 318 is associated with DMAC 344. Hence, arbitrator 326 can determine a high watermark and a low watermark for MCU module 318 based on a limit associated with MCU module 318. Arbitrator 326 can then determine OCCs for MCU module 318. If the OCCs of MCU module 318 is greater than or equal to the high watermark, arbitrator 326 can assign a low priority to MCU 318. On the other hand, if OCCs of MCU module 318 is less than or equal to the low watermark, arbitrator 326 can assign a high priority to MCU module 318.

Arbitrator 326 can then perform a two-phase arbitration process 360 to select an MCU module for the next available cell 330 in buffer 328. Arbitration process 360 can include a first phase arbitration 362 and a second phase arbitration 364. In arbitration 362, arbitrator 326 can select a buffer class (e.g., based on weighted round-robin selection) among the enabled buffer classes in NIC 320. In some embodiments, NIC 320 may support N pre-defined buffer classes (e.g., 10 classes), each may correspond to a traffic shaping class associated with traffic shaper 248 in FIG. 2B. A buffer class can be enabled if there are adequate resources available for that buffer class. Such resources can include transmission credits associated with retry buffer 272 and source tables 276 of FIG. 2B, and availability in buffer 328 for that buffer class. Source tables 276 can include one or more of: a source packet table (SPT), a source message table (SMT), and a source connection table (SCT).

NIC 320 can have buffer classes 352, 354, and 356 enabled. Buffer class 352 can include MCU modules 312 and 314; buffer class 354 can include MCU module 316; and buffer class 356 can include MCU module 318. By applying arbitration 362 on buffer classes 352, 354, and 356, arbitrator 326 may select buffer class 352. Arbitrator 326 can then identify MCU modules 312 and 314 associated with buffer class 352. Arbitrator 326 can then apply arbitration 364 on MCU modules 312 and 314. Arbitration 364 can select an MCU module with high priority, if available. Otherwise, arbitration 364 can select an MCU module with low priority.

Accordingly, arbitrator 326 can determine whether MCU modules 312 and 314 include an MCU module with a high priority. For example, if MCU module 312 has a high priority, arbitrator 326 may select MCU module 312. On the other hand, if MCU modules 312 and 314 have a low priority, arbitrator 326 can select one of MCU modules 312 and 314 based on a selection policy. If MCU module 312 is selected, MCU module 312 can inject a packet associated with command 342 into cell 330. It should be noted that if command 342 is larger than the MTU (e.g., a PUT command with a large amount of data), MCU module 312 may generate multiple packets based on command 342. Upon injecting the packet, MCU module 312 can obtain the next packet associated with command 342. Subsequently, MCU module 312 can again become subject to arbitration 360.

To ensure that the priorities are not allocated to an MCU module for a prolonged period, arbitrator 326 can periodically perturb the priorities. For example, the priorities can be reset (e.g., periodically or based on a reset of the NIC). On reset, a respective MCU module can be assigned a high priority. On the other hand, a respective MCU module can be associated with a priority timer. If the timer expires, the corresponding MCU module can be assigned a low priority. This perturbation may mitigate the effect of an MCU module holding a high priority for a significant period and adversely affecting the fairness of arbitration 360. By ensuring fairness in arbitration 360, NIC 320 can facilitate an efficient way of injecting packets to buffer 328.

FIG. 4A shows a flow chart of a priority allocation process for injecting packets into an output buffer in a NIC. During operation, the NIC can determine a command associated with an injector (operation 402). The NIC can then determine whether the command is a DMA command (operation 404). If the command is a DMA command, the NIC can determine high and low watermarks based on an injector-specific limit (operation 416). On the other hand, if the command is not a DMA command (e.g., an IDC), the NIC can determine high and low watermarks based on a global limit (operation 406). Subsequently, the NIC can determine whether a reset has been triggered (operation 408). If the reset has not been triggered, the NIC can also determine whether a timer associated with the injector has been expired (operation 410).

If the timer has not been expired, the NIC can determine whether the OCC associated with the injector is greater than or equal to the high watermark (operation 412). If the OCC is not greater than or equal to the high watermark, the NIC can determine whether the OCC is less than or equal to the low watermark (operation 414). If the reset has been triggered (operation 408) or the OCC is less than or equal to the low watermark (operation 414), the NIC can assign a high priority to the injector (operation 420). On the other hand, if the timer associated has been expired (operation 410) or OCC is greater than or equal to the high watermark (operation 412), the NIC can assign a low priority to the injector (operation 418).

FIG. 4B shows a flow chart of an arbitration process for injecting packets into an output buffer in a NIC. During operation, the NIC can determine the enabled buffer classes (operation 452) and select a buffer class based on a class selection policy (operation 454). The NIC can then identify the injectors associated with the buffer class (operation 456) and determine whether there is any high priority injector in the selected injectors (operation 458). If there is at least one high priority injector in the selected injectors, the NIC can select an injector from the high priority injectors based on an injector selection policy (operation 460). Otherwise, the NIC can select an injector from the low priority injectors based on the injector selection policy (operation 462).

Exemplary Computer System

FIG. 5 shows an exemplary computer system equipped with a NIC that facilitates efficient packet forwarding. Computer system 550 includes a processor 552, a memory device 554, and a storage device 556. Memory device 554 can include a volatile memory device (e.g., a dual in-line memory module (DIMM)). Furthermore, computer system 550 can be coupled to a keyboard 562, a pointing device 564, and a display device 566. Storage device 556 can store an operating system 570. An application 572 can operate on operating system 570.

Computer system 550 can be equipped with a host interface coupling a NIC 520 that facilitates efficient data request management. NIC 520 can provide one or more HNIs to computer system 550. NIC 520 can be coupled to a switch 502 via one of the HNIs. NIC 520 can include an arbitration logic block 530, as described in conjunction with FIGS. 3A and 3B. Arbitrator logic block 530 can include a tracking logic block 532, a priority logic block 534, and a selection logic block 536.

Tacking logic block 532 can track the OCC of a respective injector (e.g., an MCU module) of NIC 520. Priority logic block 534 can determine a high watermark and a low watermark for a respective injector based on a type of command associated with the injector. Priority logic block 534 can then determine and assign a priority to a respective injector, as described in conjunction with FIG. 4A. Selection logic block 536 can select an injector for injecting a packet into a shared output buffer based on the priority and a buffer class of a respective injector, as described in conjunction with FIG. 4B.

In summary, the present disclosure describes a NIC that facilitates efficient packet injection into an output buffer. The NIC can be equipped with an output buffer, a plurality of injectors, a prioritization logic block, and a selection logic block. The plurality of injectors can share the output buffer. The prioritization logic block can determine a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector. The selection logic block can then determine, from the plurality of injectors, a subset of injectors associated with a buffer class and determine whether the subset of injectors includes a high-priority injector. Upon identifying a high-priority injector in the subset of injectors, the selection logic block can select the high-priority injector for injecting a packet in the output buffer.

The methods and processes described above can be performed by hardware logic blocks, modules, logic blocks, or apparatus. The hardware logic blocks, modules, logic blocks, or apparatus can include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), dedicated or shared processors that execute a piece of code at a particular time, and other programmable-logic devices now known or later developed. When the hardware logic blocks, modules, or apparatus are activated, they perform the methods and processes included within them.

The methods and processes described herein can also be embodied as code or data, which can be stored in a storage device or computer-readable storage medium. When a processor reads and executes the stored code or data, the processor can perform these methods and processes.

The foregoing descriptions of embodiments of the present invention have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention. The scope of the present invention is defined by the appended claims. 

What is claimed is:
 1. A network interface controller (NIC), comprising: an output buffer; a plurality of injectors to share the output buffer; a prioritization logic block to determine a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector; and a selection logic block to: determine, from the plurality of injectors, a subset of injectors associated with a buffer class; determine whether the subset of injectors includes a high-priority injector; and in response to identifying a high-priority injector in the subset of injectors, select the high-priority injector for injecting a packet in the output buffer.
 2. The network interface controller of claim 1, wherein, in response to determining that subset of injectors does not include a high-priority injector, the selection logic block is further to select a low-priority injector for injecting a packet in the output buffer.
 3. The network interface controller of claim 1, wherein the prioritization logic block is further to: determine a command type associated with a respective injector; in response the command type being an immediate data command (IDC), determine the high watermark and the low watermark based on a global limit; and in response the command type being a direct memory access (DMA) command, determine the high watermark and the low watermark based on a limit specific to the injector.
 4. The network interface controller of claim 3, wherein the command is issued to the network interface controller via a peripheral component interconnect express (PCIe) interface.
 5. The network interface controller of claim 1, wherein the prioritization logic block is further to obtain a number of units in the buffer being occupied by data from a respective injector.
 6. The network interface controller of claim 5, wherein the prioritization logic block is further to: assign a high priority to the injector in response to the number of units being less than or equal to the low watermark; and assign a low priority to the injector in response to the number of units being greater than or equal to the high watermark.
 7. The network interface controller of claim 1, wherein the prioritization logic block is further to: assign a high priority to the injector in response to detecting a reset of priorities; and assign a low priority to the injector in response to detecting a timer expiration associated with the injector.
 8. The network interface controller of claim 1, wherein the selection logic block is further to select the buffer class from a set of buffer classes enabled for the network interface controller.
 9. The network interface controller of claim 1, wherein an injector is a message chopping unit (MCU) to generate a packet from a command issued to the network interface controller.
 10. The network interface controller of claim 1, wherein the output buffer is divided into a number of cells; and wherein injecting the packet comprises injecting the packet into a next available cell.
 11. A method, comprising: identifying a plurality of injectors sharing an output buffer in a network interface controller (NIC); determining a priority associated with a respective injector based on a high watermark and a low watermark associated with the injector; determining, from the plurality of injectors, a subset of injectors associated with a buffer class; determining whether the subset of injectors includes a high-priority injector; and in response to identifying a high-priority injector in the subset of injectors, selecting the high-priority injector for injecting a packet in the output buffer.
 12. The method of claim 11, in response to determining that subset of injectors does not include a high-priority injector, the method further comprises selecting a low-priority injector for injecting a packet in the output buffer.
 13. The method of claim 11, further comprising: determining a command type associated with a respective injector; in response the command type being an immediate data command (IDC), determining the high watermark and the low watermark based on a global limit; and in response the command type being a direct memory access (DMA) command, determining the high watermark and the low watermark based on a limit specific to the injector.
 14. The method of claim 13, wherein the command is issued to the NIC via a peripheral component interconnect express (PCIe) interface.
 15. The method of claim 11, further comprising obtaining a number of units in the buffer being occupied by data from a respective injector.
 16. The method of claim 15, further comprising: assigning a high priority to the injector in response to the number of units being less than or equal to the low watermark; and assigning a low priority to the injector in response to the number of units being greater than or equal to the high watermark.
 17. The method of claim 11, further comprising: assigning a high priority to the injector in response to detecting a reset of priorities; and assigning a low priority to the injector in response to detecting a timer expiration associated with the injector.
 18. The method of claim 11, further comprising selecting the buffer class from a set of buffer classes enabled for the NIC.
 19. The method of claim 11, wherein an injector is a message chopping unit (MCU) to generate a packet from a command issued to the NIC.
 20. The method of claim 11, wherein the output buffer is divided into a number of cells; and wherein injecting the packet comprises injecting the packet into a next available cell. 